Dynamic Text in Illustrate

Dynamic text is user-built data-driven text that is linked to a discovery. The text uses dynamic PQL functions to obtain and display the required information.

Dynamic text is constructed in the Dynamic Text Editor in Illustrate and then added to presentations and publications. When the presentations and publications are rendered, the dynamic text shows the current data-driven values of the given dynamic functions.

Building Dynamic Text

This task describes how to add a text box and set up a dynamic function that changes its appearance dynamically.

Before you begin

The data used by your dynamic text is retrieved from either a matrix grid created in Discover or a visual area created in Tabulate. You need to ensure this content is saved (and will therefore be available for selection) before you begin this process.

Tip: Using Tabulate data allows you to blend queries from multiple data sources into a single grid, allowing the dynamic text to be based on multiple data sources.

Step 1: Open the Dynamic Text Editor

Dynamic text is configured in the Dynamic Text Editor (purple highlight below):

  1. Add a text box to the canvas.
  2. Use the Text control (green arrow below) in the left-hand toolbox.

  3. With the text box selected (blue arrow), click Dynamic Text on the Text (Component) ribbon.
  4. The Dynamic Text Editor opens at the bottom of the page:

Tip: You can also open the Dynamic Text dropdown list and select Dynamic Text on the submenu (yellow highlight above) to perform the same action. The other item on the dropdown list is Place Holder, which allows you to include placeholder text in your text box.

Step 2: Add Dynamic Text

Creating dynamic text works the same way in Illustrate, Present, and Publish. In all cases, you are defining a variable whose value is pulled from or calculated using the data model. For infographics, the dynamic text will only be replaced once it is embedded in a publication or presentation (at build time for publications and at runtime for presentations).

  1. Open the Content dropdown list (orange arrow above) and select either the Grid from a discovery or the visual area from a tabulation that you want to base your dynamic formula on.
  2. Once selected, the Grid or visual area opens in the editor window (green arrow).

  3. Build your dynamic expression in the script editor (blue arrow):
    • Use the PQL Functions library (yellow highlight) to add SQL expressions to your script. You can hover over the items in the tree to view details of each function and double-click to copy a function into the script editor.
    • Select the relevant cells from the grid to populate the given PQL expressions with data. You can click data cells to add the cell value to your expression or, if your source is a matrix grid, click the label, column header, or row header to add the respective content or total of the column or row values instead.
  4. Once you are happy with your dynamic expression, you should Test your expression and then click Set to create your dynamic function and close the wizard.
  5. Once you have Set your function, the variable is added to the canvas with a highlighted, green background (purple arrow).

  6. Check that the name of your Function (supplied at the top of the Dynamic Text panel) is selected as the Actual Value in the Text panel (brown highlight).

Note: The example above replaces the variable with the selected sales value formatted to two decimal places and applies conditional coloring, changing the background to orange when the value is less than 70,000 and blue otherwise (see Properties).

Dynamic PQL Functions

The Pyramid Query Language (PQL), pronounced "Prequel," is a language built into Pyramid's PYRANA engine to allow users to construct queries that can run against the many SQL data stacks that Pyramid can query natively. PQL includes a vast array of operations and functions that allow users to query data and build analytical logic.

The Dynamic Text Editor exposes Dynamic and Common functions. Dynamic functions are a set of specialized methods that are designed to act on a given query's result set. Common functions are a set of methods that are found in most programmatic and mathematical function libraries. These functions are used to perform logic on basic data without concern for data structures, context, or even source.

To add a PQL function from the library to the script editor, simply double click on it. You will then need to inject values into the function.

Using the LLM AI-Driven PQL Function

Pyramid's Generative AI integration enables you to use AI to generate scripts and images, dynamic text and infographics, calculations and lists, schedules, colors, and more. It allows you to generate a range of content, including complex code, simply by providing a text prompt.

Tip: You can use the LLM PQL function (from the Common PQL functions) to generate dynamic text, adding the results to custom tooltips, text fields, or into your PQL formulas. While this function cannot tell you about your data set, it can add additional information and background to your presentation or publication.

Warning: When using LLMs, your assets are generated using public domain algorithms. This can produce erroneous and inconsistent or random results. Use at your own risk.

Step 3: Set the Dynamic Text Properties

You can set Properties to control whether dynamic text is shown or hidden, and to change its size, rotation, and for the variable text its foreground color, background color, and text properties based on an Actual Value.

To define these behaviors, select the text box or dynamic variable and use the Properties panel to choose the Actual Value and specify the condition that triggers a change.

  • Click here to learn about Dynamic Text Properties.

What next?

Once you have set up your illustration, you need to Save it and then use it in one of your publications or presentations.

For details describing how to use your dynamic illustration in a presentation or publication, see:

Examples

Basic Dynamic Text Example

In this example, the dynamic text will be driven by a grid listing sales by manufacturer, in descending order. The text should display the name of the top manufacturer and its sales.

Using Tabulate for Multiple Source Grids

Users requiring dynamic text from disparate data based on multiple queries can use Tabulate as the source for dynamic text. Tabulate allows you to blend queries from multiple data sources into a single tabulation. You must then define a Visual Area that can be used as a single data source for the dynamic text. The Visual Area can then be used as a source for the data grid that the dynamic text is based on.